package com.zhx.basis.设计模式.策略模式.demo1;

import java.math.BigDecimal;

public class Main {
    public static void main(String[] args) {
            // 直减；100-10，商品100元
            Context<Double> context = new Context<Double>(new ZJCouponDiscount());
            BigDecimal discountAmount = context.discountAmount(10D, new BigDecimal(100));
        System.out.println(String.format("测试结果：直减优惠后金额 {%s}", discountAmount));


        ICouponDiscount zjCouponDiscount = new ZJCouponDiscount();
        BigDecimal zj = zjCouponDiscount.discountAmount(10D, new BigDecimal(100));
        System.out.println(String.format("测试结果：直减优惠后金额 {%s}", zj));
    }
}
